package com.subway.babynote.syncservice;
import android.app.*;
import android.content.Context;
import android.telephony.TelephonyManager;

public class deviceManager {
	Context parent = null;
	String imsi = null;
	String imei = null;
	public deviceManager(Context c)
	{
		this.parent = c;
	}
	private TelephonyManager getTM()
	{
		return (TelephonyManager)this.parent.getSystemService(Context.TELEPHONY_SERVICE);
		
	}
	
	private boolean getIMEI(TelephonyManager tm)
	{
		boolean b = true;
		imei = tm.getDeviceId();
		imei = imei==null?"":imei;
		
		return b;
	}
	
	private boolean getIMSI(TelephonyManager tm)
	{
		boolean b = true;
		imsi = tm.getSubscriberId();
		imsi = imsi==null? "":imsi;
		
		return b;
	}
	public boolean Init()
	{
		TelephonyManager tm = this.getTM();
		if(tm != null)
		{
			this.getIMEI(tm);
			this.getIMSI(tm);
			return true;
		}
		else
			return false;
	}
	
	public String getIMEI()
	{
		return this.imei;
	}
	public String getIMSI()
	{
		return this.imsi;
	}

}
